package arr;

import java.util.Random;

public class Arrays {

    private int[][] array;
    private int i;
    private int j;

    public Arrays(int i, int j) {
        this.i = i;
        this.j = j;
        array = new int[i][j];
    }

    public void Display() {
        for (int k = 0; k < i; k++) {
            System.out.print("[  ");
            for (int l = 0; l < j; l++) {
                System.out.print(array[k][l] + " ");
            }
            System.out.println(" ]");
        }
        System.out.println("");
    }

    public void Fill() {
        Random rand = new Random();
        for (int k = 0; k < i; k++) {
            for (int l = 0; l < j; l++) {
                array[k][l] = rand.nextInt(10);
            }
        }
    }

    public void Transponate() {
        int[][] arr = new int[i][j];
        for (int k = 0; k < i; k++) {
            for (int l = 0; l < j; l++) {
                arr[k][l] = array[l][k];
            }
        }
        array = arr;
    }

    public void showDeter() {
        System.out.println(array[1][1]);
    }
}
